/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2017
 */

package models.model;

import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import common.base.mybatis.BaseEntity;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class Computers extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Computers";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_COMPUTER_NO = "电脑编号";
	public static final String ALIAS_COMPUTER_ROOM_ID = "所属机房id";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	
	private java.lang.Integer computerNo;
	
	private java.lang.Integer computerRoomId;
	//columns END

	public Computers(){
	}

	public Computers(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setComputerNo(java.lang.Integer value) {
		this.computerNo = value;
	}
	
	public java.lang.Integer getComputerNo() {
		return this.computerNo;
	}
	public void setComputerRoomId(java.lang.Integer value) {
		this.computerRoomId = value;
	}
	
	public java.lang.Integer getComputerRoomId() {
		return this.computerRoomId;
	}
	
	private Set repairss = new HashSet(0);
	public void setRepairss(Set<Repairs> repairs){
		this.repairss = repairs;
	}
	
	public Set<Repairs> getRepairss() {
		return repairss;
	}
	
	private ComputerRoom computerRoom;
	
	public void setComputerRoom(ComputerRoom computerRoom){
		this.computerRoom = computerRoom;
	}
	
	public ComputerRoom getComputerRoom() {
		return computerRoom;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("ComputerNo",getComputerNo())
			.append("ComputerRoomId",getComputerRoomId())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Computers == false) return false;
		if(this == obj) return true;
		Computers other = (Computers)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

